package com.kric.boot.service.impl;

import com.kric.boot.entity.UserInfo;
import com.kric.boot.jpa.UserJPA;
import com.kric.boot.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName UserServiceImpl
 * @Author: zhaozy
 * @Date: 2018-8-1 17:25
 * @Description:
 */
@Service
public class UserServiceImpl implements IUserService {
    @Autowired
    private UserJPA userJPA;

    @Override
    public List<UserInfo> findAll() {
        return userJPA.findAll();
    }

    @Override
    public UserInfo findOne(Long id) {
        return userJPA.getOne(id);
    }

    @Override
    public void del(Long id) {
        userJPA.deleteById(id);
    }

    @Override
    public void saveOrUpdate(UserInfo userInfo) {
        userJPA.save(userInfo);
    }
}
